*********************************
** Logan Strother              **
** Replication File _ Fig 3    **
** Journal of Law & Courts     **
** Beyond Kelo: Exp. Study     **
** MTurk Experiment            **
** 6/10/15 - 4/22/16           **
*********************************

version 14.1
set more off, permanently
set matsize 800

* log

*** For data, see lines 35 to 62 in Main replication file
*** I pasted in means and sds into the data editor for each graph
*** I.e. line37-line42=graph1, line43-line48=graph2, line49-line54=graph3, line55-line60=graph4
*** This is done one graph at a time: so paste in data for graph1, then run the do file; repeat for each graph
*** After creating all 4 graphs, the last part of the do file combines the graphs into the final figure (Fiigure 3)

**********************************
*** Begin creating graphs for Fig 3

* This section of the code is run for each graph:
gen lo=mean-1*(sd*2)
gen hi=mean+1*(sd*2)
*input x vector with the order of variables I want to plot*
mat x=(1,2,3)'
*gets x vector copied to a variable called x*
svmat x
label def varnames 3 "Mall (vs Road)" 2 "Home (vs Lot)" 1 "Imagine (vs null)"
label val x varnames
label var mean "mean"
label var sd "sd"
label var lo "lo"
label var hi "hi"

*********************************
*** The following sections are of code are used one at a time, for the indicated graph
*** Delete asterisks for appropriate section to create each graph
* Graph1 (Top left in Figure 3) :: Delete asterisks on lines 45 and 46 to create graph1
*     specify where you want the graph saved on line 46
* {N for supportemdom = 706}
* twoway rspike lo hi x, horizontal || scatter x mean, sort  ylabel(1(1)3, valuelabel angle(0)) title("Opposition to Taking") ytitle("Treatment") legend(off) xscale(range(0,.15)) scheme(s1mono) scale(1) xline(0, lcolor(gray) lpattern(dash))
* graph save Graph "C:\Users\Logan\Desktop\JLC_fig3_DV1.gph"

* Graph2 (Top right in Figure 3) :: Delete asterisks on lines 51 and 52 to create graph1
*     specify where you want the graph saved on line 52
* {N for supportemdom = 699}
* twoway rspike lo hi x, horizontal || scatter x mean, sort  ylabel(1(1)3,  valuelabel angle(0)) title("Strength of Opposition to Taking") legend(off) xscale(range(0,.15))  scheme(s1mono) scale(1) xline(0, lcolor(gray) lpattern(dash))
* graph save Graph "C:\Users\Logan\Desktop\JLC_fig3_DV2.gph"

* Graph3 (Bottom left in Figure 3) :: Delete asterisks on lines 57 and 58 to create graph1
*     specify where you want the graph saved on line 58
* {N for supportemdom = 694}
* twoway rspike lo hi x, horizontal || scatter x mean, sort  ylabel(1(1)3,  valuelabel angle(0)) title("Anger Expressed at Taking") xtitle("Diff in Means") ytitle("Treatment") legend(off) xscale(range(0,.15))  scheme(s1mono) scale(1) xline(0, lcolor(gray) lpattern(dash))
* graph save Graph "C:\Users\Logan\Desktop\JLC_fig3_DV3.gph"

* Graph4 (Bottom right in Figure 3) :: Delete asterisks on lines 63 and 64 to create graph1
*     specify where you want the graph saved on line 64
* {N for supportemdom = 692}
* twoway rspike lo hi x, horizontal || scatter x mean, sort  ylabel(1(1)3,  valuelabel angle(0)) title("Support for Anti-Taking Cong Bill") xtitle("Diff in Means") legend(off) xscale(range(0,.15))  scheme(s1mono) scale(1) xline(0, lcolor(gray) lpattern(dash))
* graph save Graph "C:\Users\Logan\Desktop\JLC_fig3_DV4.gph"

*** To Create the Final Figure 3: 
* delete asterisk on line 68 after specifyting the correct file destinations for the 4 graphs
* graph combine "C:\Users\Logan\Desktop\JLC_fig3_DV1.gph" "C:\Users\Logan\Desktop\JLC_fig3_DV2.gph" "C:\Users\Logan\Desktop\JLC_fig3_DV3.gph" "C:\Users\Logan\Desktop\JLC_fig3_DV4.gph"
* save the final Figure 3 by deleting the asterisk on line 70 after specifying the save location you want
* graph save Graph "C:\Users\Logan\Desktop\JLC_fig3_combined.gph"
